(() => {
	let ele = {};
	ele.download = $('#download');
	ele.modal_link = $('#modal-link');
	
	var ua = navigator.userAgent.toLowerCase();
	if (/micromessenger/.test(ua) || /qq/.test(ua) || /QQ/.test(ua)) { // ios和andoid通用判断微信、qq
		ele.download.removeAttribute('href');
		ele.download.removeAttribute('download');
		// 模态框显示
		ele.download.onclick = () => {
			ele.modal_link.style.display = 'block';
		}
	} else {
		// navigator.userAgent 属性 判断设备类型
		if (/(iPhone|iPad|iPod|iOS)/i.test(ua)) { //判断iPhone|iPad|iPod|iOS
			ele.download.href = 'http://img.qunx.top/xianwang/apk/app.mobileconfig';
			ele.download.onclick = () => {
				setTimeout(function(){
					location.href = "http://img.qunx.top/xianwang/apk/app.mobileprovision";
				},3000);
			}
		} else if (/(Android)/i.test(ua)) { //判断Android
			ele.download.href = 'http://img.qunx.top/xianwang/apk/xianwang.apk';
		} else { //pc
			ele.download.href = 'http://img.qunx.top/xianwang/apk/xianwang.apk';
		}
	}
	
	
})();